/**
 * 
 */
package com.peycash.monitoring.ws.impl;

import java.rmi.RemoteException;

import org.springframework.stereotype.Component;

import com.icm.webServices.SmartICMv2WebServiceProxy;
import com.peycash.monitoring.utils.Constantes;
import com.peycash.monitoring.ws.SMSSender;

/**
 * @author JAMARO
 *
 */
@Component
public class SMSSenderImpl implements SMSSender {

	private SmartICMv2WebServiceProxy proxy;
	
	//TODO sacar esto de un properties y monitorear cambios cada hora o algo asi
	private String user;
	private String password;
	private String gateway;
	
	public SMSSenderImpl(){
		proxy = new SmartICMv2WebServiceProxy();
		user="teknei2014 ";
		password="teKnei#21";
		gateway="2";
	}
	
	@Override
	public String sendSMS(String numCel, String message){
		String response;
		try {
			response = proxy.sendSMS(user, password, gateway, numCel, message, "", "");
		} catch (RemoteException e) {
			return Constantes.ERROR_GENERAL;
		}
		return response;
	}
}
